<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>其它变更</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="migration73.deprecated.html">« PHP 7.3.x 中废弃的功能</a></li>
      <li style="float: right;"><a href="migration73.windows-support.html">Windows 支持 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="migration73.html">从 PHP 7.2.x 移植到 PHP 7.3.x</a></li>
    <li>其它变更</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="migration73.other-changes" class="sect1">
 <h2 class="title">其它变更</h2>

 <div class="sect2" id="migration73.other-changes.core">
  <h3 class="title">PHP 核心</h3>

  <div class="sect3" id="migration73.other-changes.core.setcookie">
   <h4 class="title">Set(raw)cookie 函数接受 $option 数组参数</h4>

   <p class="para">
    <span class="function"><a href="function.setcookie.html" class="function">setcookie()</a></span> and <span class="function"><a href="function.setrawcookie.html" class="function">setrawcookie()</a></span> now also
    support the following signature:
    <div class="methodsynopsis dc-description">
     <span class="methodname"><a href="function.setcookie.html" class="methodname">setcookie</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code><span class="initializer"> = &quot;&quot;</span></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code><span class="initializer"> = []</span></span>): <span class="type">bool</span></div>

    where <code class="literal">$options</code> is an associative array which may have
    any of the keys <code class="literal">&quot;expires&quot;</code>, <code class="literal">&quot;path&quot;</code>,
    <code class="literal">&quot;domain&quot;</code>, <code class="literal">&quot;secure&quot;</code>,
    <code class="literal">&quot;httponly&quot;</code> and <code class="literal">&quot;samesite&quot;</code>.
   </p>
  </div>

  <div class="sect3" id="migration73.other-changes.core.syslog">
   <h4 class="title">新的 Syslog ini 配置</h4>

   <p class="para">
    如果 <a href="errorfunc.configuration.html#ini.error-log" class="link">error_log</a> 设置为
    <code class="literal">syslog</code>，则新增以下 ini 指令来自定义日志记录：
    <dl>
     
      <dt>
<a href="errorfunc.configuration.html#ini.syslog.facility" class="link">syslog.facility</a></dt>

      <dd>

       <span class="simpara">
        指定记录消息的程序类型。
       </span>
      </dd>

     
     
      <dt>
<a href="errorfunc.configuration.html#ini.syslog.filter" class="link">syslog.filter</a></dt>

      <dd>

       <span class="simpara">
        指定过滤纪录消息的过滤器类型，支持的过滤器类型——<code class="literal">all</code>、<code class="literal">no-ctrl</code>
        和 <code class="literal">ascii</code>。自 PHP 7.3.8 起，<code class="literal">raw</code>
        也可以使用，恢复了 syslog 在之前 PHP 版本中的行为方式。此过滤器还会影响
        <span class="function"><a href="function.syslog.html" class="function">syslog()</a></span> 的调用，
       </span>
      </dd>

     
     
      <dt>
<a href="errorfunc.configuration.html#ini.syslog.ident" class="link">syslog.ident</a></dt>

      <dd>

       <span class="simpara">
        指定在每条消息前面添加的标识符（ident）字符串。
       </span>
      </dd>

     
    </dl>

   </p>
  </div>

  <div class="sect3" id="migration73.other-changes.core.gc">
   <h4 class="title">垃圾回收机制</h4>

   <p class="para">
    <a href="features.gc.collecting-cycles.html" class="link">循环 GC</a>
    已增强，这可能会带来相当大的性能改进。
   </p>
  </div>

  <div class="sect3" id="migration73.other-changes.core.misc">
   <h4 class="title">其它</h4>

   <p class="para">
    <span class="function"><a href="function.var-export.html" class="function">var_export()</a></span> now exports <span class="classname"><a href="class.stdclass.html" class="classname">stdClass</a></span>
    objects as an array cast to an object (<code class="code">(object) array( ... )</code>), rather
    than using the nonexistent method <span class="methodname"><strong>stdClass::__setState()</strong></span>.
   </p>

   <p class="para">
    <span class="function"><a href="function.debug-zval-dump.html" class="function">debug_zval_dump()</a></span> was changed to display recursive arrays
    and objects in the same way as <span class="function"><a href="function.var-dump.html" class="function">var_dump()</a></span>. Now, it doesn&#039;t
    display them twice.
   </p>

   <p class="para">
    <span class="function"><a href="function.array-push.html" class="function">array_push()</a></span> and <span class="function"><a href="function.array-unshift.html" class="function">array_unshift()</a></span> can
    now also be called with a single argument, which is particularly convenient
    wrt. the spread operator.
   </p>
  </div>

 </div>

 <div class="sect2" id="migration73.other-changes.phpdbg">
  <h3 class="title">交互式 PHP 调试程序</h3>

  <p class="para">
   The unused constants <strong><code>PHPDBG_FILE</code></strong>,
   <strong><code>PHPDBG_METHOD</code></strong>, <strong><code>PHPDBG_LINENO</code></strong> and
   <strong><code>PHPDBG_FUNC</code></strong> have been removed.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.fpm">
  <h3 class="title">FastCGI 进程管理器</h3>

  <p class="para">
   <span class="function"><a href="function.getallheaders.html" class="function">getallheaders()</a></span> 函数现已可用。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.curl">
  <h3 class="title">Client URL Library</h3>

  <p class="para">
   libcurl ≥ 7.15.5 is now required.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.filter">
  <h3 class="title">Data Filtering</h3>

  <p class="para">
   <strong><code>FILTER_VALIDATE_FLOAT</code></strong> now also supports a <code class="literal">thousand</code>
   option, which defines the set of allowed thousand separator chars.  The default
   (<code class="code">&quot;&#039;,.&quot;</code>) is fully backward compatible with former PHP versions.
  </p>

  <p class="para">
   <strong><code>FILTER_SANITIZE_ADD_SLASHES</code></strong> has been added as an alias of the
   <code class="literal">magic_quotes</code> filter (<strong><code>FILTER_SANITIZE_MAGIC_QUOTES</code></strong>).
   The <code class="literal">magic_quotes</code> filter is subject to removal in future versions of PHP.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.ftp">
  <h3 class="title">FTP</h3>

  <p class="para">
   The default transfer mode has been changed to <code class="literal">binary</code>.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.intl">
  <h3 class="title">国际化相关函数</h3>

  <p class="para">
   <strong><code>Normalizer::NONE</code></strong> is deprecated, when PHP is linked with
   ICU ≥ 56.
  </p>

  <p class="para">
   Introduced <strong><code>Normalizer::FORM_KC_CF</code></strong> as
   <span class="methodname"><a href="normalizer.normalize.html" class="methodname">Normalizer::normalize()</a></span> argument for
   <code class="literal">NFKC_Casefold</code> normalization; available when linked with
   ICU ≥ 56.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.json">
  <h3 class="title">JavaScript Object Notation</h3>

  <p class="para">
   A new flag has been added, <strong><code>JSON_THROW_ON_ERROR</code></strong>, which
   can be used with <span class="function"><a href="function.json-decode.html" class="function">json_decode()</a></span> or
   <span class="function"><a href="function.json-encode.html" class="function">json_encode()</a></span> and causes these functions to throw the new
   <span class="classname"><a href="class.jsonexception.html" class="classname">JsonException</a></span> upon an error, instead of setting the
   global error state that is retrieved with
   <span class="function"><a href="function.json-last-error.html" class="function">json_last_error()</a></span> and <span class="function"><a href="function.json-last-error-msg.html" class="function">json_last_error_msg()</a></span>.
   <strong><code>JSON_PARTIAL_OUTPUT_ON_ERROR</code></strong> takes precedence over
   <strong><code>JSON_THROW_ON_ERROR</code></strong>.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.mbstring">
  <h3 class="title">Multibyte String</h3>

  <p class="para">
   The configuration option <strong class="option configure">--with-libmbfl</strong> is
   no longer available.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.uodbc">
  <h3 class="title">ODBC (Unified)</h3>

  <p class="para">
   Support for <code class="literal">ODBCRouter</code> and <code class="literal">Birdstep</code>
   including the <code class="literal">birdstep.max_links</code> ini directive has been
   removed.
  </p>
 </div>

 <div class="sect2" id="migration72.other-changes.opcache">
  <h3 class="title">OPcache</h3>

  <p class="para">
   The <code class="literal">opcache.inherited_hack</code> ini directive has been removed.
   The value has already been ignored since PHP 5.3.0.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.openssl">
  <h3 class="title">OpenSSL</h3>

  <p class="para">
   The <code class="literal">min_proto_version</code> and <code class="literal">max_proto_version</code>
   ssl stream options as well as related constants for possible TLS protocol values
   have been added.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.pcre">
  <h3 class="title">Regular Expressions (Perl-Compatible)</h3>

  <p class="para">
   The <a href="book.pcre.html" class="link">PCRE extension</a> has been upgraded to
   PCRE2, which may cause minor behavioral changes (for instance, character
   ranges in classes are now more strictly interpreted), and augments the
   existing regular expression syntax.
  </p>

  <p class="para">
   <span class="function"><a href="function.preg-quote.html" class="function">preg_quote()</a></span> now also escapes the <code class="literal">&#039;#&#039;</code>
   character.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.pdo-dblib">
  <h3 class="title">Microsoft SQL Server and Sybase Functions (PDO_DBLIB)</h3>

  <p class="para">
   The attribute <strong><code>PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS</code></strong> to enable automatic
   skipping of empty rowsets has been added.
  </p>

  <p class="para">
   The <strong><code>PDO::DBLIB_ATTR_TDS_VERSION</code></strong> attribute which exposes
   the TDS version has been added.
  </p>

  <p class="para">
    DATETIME2 columns are now treated like DATETIME columns.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.pdo-sqlite">
  <h3 class="title">SQLite Functions (PDO_SQLITE)</h3>

  <p class="para">
   SQLite3 databases can now be opened in read-only mode by setting the
   new <strong><code>PDO::SQLITE_ATTR_OPEN_FLAGS</code></strong> attribute to
   <strong><code>PDO::SQLITE_OPEN_READONLY</code></strong>.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.session">
  <h3 class="title">Session Handling</h3>

  <p class="para">
   <span class="function"><a href="function.session-set-cookie-params.html" class="function">session_set_cookie_params()</a></span> now also supports the
   following signature:
   <div class="methodsynopsis dc-description">
    <span class="methodname"><a href="function.session-set-cookie-params.html" class="methodname">session_set_cookie_params</a></span>(<span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code></span>): <span class="type">bool</span></div>

   where <code class="literal">$options</code> is an associative array which may have
   any of the keys <code class="literal">&quot;lifetime&quot;</code>, <code class="literal">&quot;path&quot;</code>,
   <code class="literal">&quot;domain&quot;</code>, <code class="literal">&quot;secure&quot;</code>,
   <code class="literal">&quot;httponly&quot;</code> and <code class="literal">&quot;samesite&quot;</code>. Accordingly,
   the return value of <span class="function"><a href="function.session-get-cookie-params.html" class="function">session_get_cookie_params()</a></span> now also
   has an element with the key <code class="literal">&quot;samesite&quot;</code>.
   Furthermore, the new <code class="literal">session.cookie_samesite</code> ini option to
   set the default of the SameSite directive for cookies has been added. It
   defaults to <code class="literal">&quot;&quot;</code> (empty string), so no SameSite directive is
   set. Can be set to <code class="literal">&quot;Lax&quot;</code> or <code class="literal">&quot;Strict&quot;</code>,
   which sets the respective SameSite directive.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.tidy">
  <h3 class="title">Tidy</h3>

  <p class="para">
   Building against <a href="https://github.com/petdance/tidyp" class="link external">&raquo;&nbsp;tidyp</a> is now also
   supported transparently. Since tidyp offers no API to get the release date,
   <span class="function"><a href="tidy.getrelease.html" class="function">tidy_get_release()</a></span> and <span class="methodname"><a href="tidy.getrelease.html" class="methodname">tidy::getRelease()</a></span>
   return <code class="literal">&#039;unknown&#039;</code> in this case.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.xml">
  <h3 class="title">XML Parser</h3>

  <p class="para">
   The return value of the <span class="function"><a href="function.xml-set-external-entity-ref-handler.html" class="function">xml_set_external_entity_ref_handler()</a></span>
   callback is no longer ignored if the extension has been built against libxml.
   Formerly, the return value has been ignored, and parsing did never stop.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.zip">
  <h3 class="title">Zip</h3>

  <p class="para">
   Building against the bundled libzip is discouraged, but still possible by
   adding <strong class="option configure">--without-libzip</strong> to the configuration.
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.zlib">
  <h3 class="title">Zlib Compression</h3>

  <p class="para">
   The zlib/level context option for the <a href="wrappers.compression.html" class="link">compress.zlib wrapper</a> to facilitate
   setting the desired compression level has been added.
  </p>
 </div>

</div></div></div></body></html>